package com.itheima.tilas.controller;

import com.itheima.tilas.Utils.ResultUtil;
import com.itheima.tilas.entity.Log;
import com.itheima.tilas.po.SelectLogPageParam;
import com.itheima.tilas.service.LogService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Objects;

/**
 * 日志控制层
 *
 * @author 132
 */
@RestController
@RequestMapping("/log")
public class LogController {
    @Resource
    LogService logService;

    @GetMapping("/page")
    public ResultUtil selectLogPage(SelectLogPageParam param) {
        if (Objects.isNull(param)) {
            return ResultUtil.fail("本次查询失败");
        }
        return logService.selectLogPage(param);
    }
}
